
from flask import Flask, render_template
import config
from exts import db
from models import DataModel
from blueprints.index import bp as index_bp
from blueprints.calculate import bp as cal_bp
from flask_migrate import Migrate

app = Flask(__name__)

#绑定配置文件
app.config.from_object(config)

#防止在创建的时候就绑定db
db.init_app(app)

app.register_blueprint(index_bp)#注册蓝图
app.register_blueprint(cal_bp) 
migrate = Migrate(app,db)

#

if __name__ == '__main__':
    app.run(host='0.0.0.0',port=5000,debug=True)